<div class="contentArea">
    <div class="Item hr">
        <div class="current">添加广告</div>
        <div class="fr"><a href="{:U('index')}" class="btn">广告列表</a></div>
    </div>
    <form>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
            <tr>
                <th width="80">广告名称：</th>
                <td><input name="myad[adname]" id="adname" type="text" class="input" size="30" /></td>
            </tr>
            <tr>
                <th width="80">广告标识：</th>
                <td><input name="myad[tagname]"  id="tagname" type="text" class="input" size="30" /> <span onclick="ShowHide('help_tagname')" class="icon-question-sign hand" title="帮助"></span> <span id="help_tagname">(使用英文或数字表示的简洁标识)</span></td>
            </tr>
            <tr>
            	<th>时间限制：</th>
                <td>
                	<label><input type="radio" name="myad[timeset]" value="0" checked /> 永不过期 </label>
                	<label><input type="radio" name="myad[timeset]" value="1" /> 在设内时间内有效 </label>
                </td>
            </tr>
            <tr>
            	<th>投放时间：</th>
                <td>
                	从<input type="text" name="myad[starttime]" id="starttime" value="{:date('Y-m-d', time())}" class="input" /><img onclick="javascript:NewCssCal('starttime', 'YYYYMMDD')" style="cursor:pointer; margin-left:2px" src="/Public/admin/js/datepicker/images2/cal.gif">
                     到 <input type="text" name="myad[endtime]" id="endtime" value="{:date('Y-m-d', strtotime('+1 month'))}" class="input" /><img onclick="javascript:NewCssCal('endtime', 'YYYYMMDD')" style="cursor:pointer; margin-left:2px" src="/Public/admin/js/datepicker/images2/cal.gif">
                </td>
            </tr>
            
        </table>
        <div class="Item hr">
            <div class="current">广告内容</div>
        </div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
        	<tr>
            	<td colspan="2">
                	<label><input type="radio" value="code" name="adtype" class="adtype" checked /> 代码</label>
                	<label><input type="radio" value="txt" name="adtype" class="adtype" /> 文字</label>
                	<label><input type="radio" value="image" name="adtype" class="adtype" /> 图片</label>
                	<label><input type="radio" value="flash" name="adtype" class="adtype" /> Flash</label>
                </td>
            </tr>
            <tbody id="advert">
                
            </tbody>
        </table>
        <div class="Item hr">
            <div class="current">过期显示内容</div>
        </div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
        	<tr>
            	<td><textarea name="myad[expbody]" rows="5" cols="91"></textarea></td>
            </tr>
        </table>
    </form>
    <div class="commonBtnArea" >
        <button class="btn submit">提交</button>
    </div>
</div>
<div style="display:none" id="formtxt">
    <div class="content" id="code" style="display:none;">
        <table>
<tr class="b">
          <td width="20%"><b>广告代码:</b><br>
            请填写广告代码，支持html代码</td>
          <td><textarea name="normbody[htmlcode]" rows="5" cols="50"></textarea></td>
        </tr>
</table>
    </div>
    <div class="content" id="txt" style="display:none;">
        <table>
<tr>
          <th class="b" width="20%"><b>文字内容*</b></th>
          <td class="b"><input type="text" size="70" name="normbody[title]" value="" class='input'/></td>
        </tr>
        <tr>
          <th class="b"><b>文字链接*</b></th>
          <td class="b"><input type="text" size="70" name="normbody[link]" value="" class='input'/></td>
        </tr>
        <tr>
          <th class="b"><b>文字颜色</b>(例如:red,#EF8684)</th>
          <td class="b"><input type="text" size="10" name="normbody[color]" value="" class='input'/></td>
        </tr>
        <tr>
          <th class="b"><b>文字大小</b>(例如:4px,12px)</th>
          <td class="b"><input type="text" size="10" name="normbody[size]" value="" class='input'/></td>
        </tr>
</table>
    </div>
    <div class="content" id="image" style="display:none;">
    	<table>
        <tr>
          <th class="b" width="20%"><b>图片地址*</b></th>
          <td class="b"><input type="text" size="40" name="normbody[url]" value="" class='input'/></td>
        </tr>
        <tr>
          <th class="b"><b>图片链接*</b></th>
          <td class="b"><input type="text" size="40" name="normbody[link]" value="" class='input'/></td>
        </tr>
        <tr>
          <th class="b"><b>图片宽度</b></th>
          <td class="b"><input type="text" size="10" name="normbody[width]" value="" class='input'/></td>
        </tr>
        <tr>
          <th class="b"><b>图片高度</b></th>
          <td class="b"><input type="text" size="10" name="normbody[height]" value="" class='input'/></td>
        </tr>
        <tr>
          <th class="b"><b>图片描述</b></th>
          <td class="b"><input type="text" size="40" name="normbody[descrip]" value="" class='input'/></td>
        </tr>
        </table>
    </div>
    <div class="content" id="flash" style="display:none;">
        <table>
<tr>
          <th class="b" width="20%"><b>flash链接</b></th>
          <td class="b"><input type="text" size="40" name="normbody[link]" value="" class='input'/></td>
        </tr>
        <tr>
          <th class="b"><b>flash宽度</b></th>
          <td class="b"><input type="text" size="40" name="normbody[width]" value="" class='input'/></td>
        </tr>
        <tr>
          <th class="b"><b>flash高度</b></th>
          <td class="b"><input type="text" size="40" name="normbody[height]" value="" class='input'/></td>
        </tr>
</table>
    </div>
    
</div>
<include file="Myad/javascript" />
<script type="text/javascript">
$(function(){
    submitForm("create");
	$(".adtype").on("click", function(){
		var type = $(this).val();
		var adFormHtml = $("div#"+type).html();
		//console.log(adFormHtml);
		$("#advert").empty().html(adFormHtml);
	});
	$(".adtype").eq(0).click();
});
</script>
